package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.TopicIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class TopicParam {

  private String topicId;

  private String title;

  private String content;

  private String courseId;

  public TopicIn paramToIn(Integer userId) {
    TopicIn in = new TopicIn();
    in.setUserId(userId);
    in.setContent(this.content);
    in.setTitle(this.title);
    in.setTopicId(NumericHelper.toInteger(this.topicId));
    in.setCourseId(NumericHelper.toInteger(this.courseId));
    return in;
  }
}
